/* eslint-disable */
import { SingleTableMixins } from '@/mixins/SingleTableMixins'
import Pagination from '@/components/Pagination'
import { getAction,putAction } from "@/api/manage";
import checkAdd from './checkAdd'
import check from '../check/check'

export default {
  mixins: [SingleTableMixins],
  components: { Pagination, checkAdd, check },
  data() {

    return {
      url: {
        list: "/inventory/list/",
      },
      show: false,
    }
  },
  mounted() {

  },
  methods: {
    cellClick(row) {
      console.log(row);
      this.show = true;
      this.$refs.checkForm.getDataByMain(row.id,row.state);
    },
    loadItem() {
      getAction("/inventory/list/").then(res => {
        this.data = res.data.records;
      })

    },
    handleFinish(id) {
      let promise;
      promise = putAction(`/inventory/end/${id}`);
      promise
        .then(res => {
          if (res.success) {
            this.$message.success(res.message);
            that.loadData();
          } else {
            this.$message.warning(res.message);
          }
        })
    },
    goBack() {
      this.show = false;
    }
  }
}